package com.mydroidchat.views;

import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import com.mydroidchat.gui.ChatArea;

import javax.swing.*;

public class ChatPanelView extends JPanel {

    private JTextField typeField;
    private ChatArea chatArea;

    public ChatPanelView() {
        super(new FormLayout("fill:default:grow", "fill:default:grow, 2dlu, pref"));

        CellConstraints cc = new CellConstraints();
        chatArea = new ChatArea();
        add(new JScrollPane(chatArea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER), cc.xy(1, 1));

        typeField = new JTextField();
        add(typeField, cc.xy(1, 3));
    }

    public ChatArea getChatArea() {
        return chatArea;
    }

    public JTextField getTypeField() {
        return typeField;
    }
}
